let app = getApp()
let isFirst = app.globalData.isFirst
Page({
  data: {
    isFirst: false,
    iconArray: [
      {
        type: '生活',
        urlPath: '../../../images/pick/shenghuo@2x.png'
      }, {
        type: '学习',
        urlPath: '../../../images/pick/xuexi@2x.png'
      }, {
        type: '签到',
        urlPath: '../../../images/pick/TO FO@2x.png'
      },
    ]
  },
  onLoad:function(){
    let teacherInfo = app.globalData.teacherInfo
    console.log(teacherInfo)
  },
  navScan:function(){
    wx.navigateTo({
      url: '../../views/mainMenu/pages/scan/pick',
    })
  },
  navLife:function(){
    wx.navigateTo({
      url: '../../views/mainMenu/pages/lifeSituation/lifeSituation',
    })
  },
  navLearning:function(){
    wx.navigateTo({
      url: '../../views/mainMenu/pages/learning/learning',
    })
  },
  // 跳转到三个功能模块
  navFunction(e){
    console.log(e.currentTarget.dataset.type)
    let type = e.currentTarget.dataset.type
    switch (type){
      case '生活':
        wx.navigateTo({
          url: '../../views/mainMenu/pages/learning/learning',
        })
      break;
      case '学习':
        wx.navigateTo({
          url: '../../views/mainMenu/pages/learning/learning',
        })
      break;
      case '签到':
        wx.navigateTo({
          url: '../../views/mainMenu/pages/scan/pick',
        })
      break;
    }
  },
  // 关闭广告
  closeAd(){
    app.globalData.isFirst = false
    this.setData({
      isFirst: app.globalData.isFirst
    })
  }
})